import Vue from 'vue'
export default{
	currency:Vue.filter('currency',function(value, currency, decimals){
	  var value = parseFloat(value);
      if (!isFinite(value) || !value && value !== 0) return '';
      var currency = currency != null ? currency : '¥';
      decimals = decimals != null ? decimals : 2;
	  return currency+value.toFixed(decimals);
	}),
	parseRoute:Vue.filter('parseRoute',function(value){
		switch (value){
			case '/home':
			return '主页';
			break;
			case '/login':
			return '登录';
			break;
			case '/news':
			return '新闻';
			break;
			case '/list':
			return '列表';
			break;
			case '/testinput':
			return '输入框';
			break;
			case '/testinput/innerInput':
			return '输入框';
			break;
			case '/testinput/innerList':
			return '输入框';
			break;
		}
	})
}